package com.ifdom.enumration;

/**
 * 1.5之后有了枚举类
 */

enum Enum15AfterDefault {
    later,
    latest,
    today,
    withParam(later.toString(), today.toString());

    Enum15AfterDefault(String name, String value) {
        this.name = name;
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public String getValue() {
        return value;
    }

    private String name;
    private String value;

    Enum15AfterDefault() {

    }


}

public class Enum15After {
    public static void main(String[] args) {
        Enum15AfterDefault today = Enum15AfterDefault.today;

        Enum15AfterDefault value = Enum15AfterDefault.valueOf("today");

        System.out.println(today);
        System.out.println(value);
        System.out.println(today == value);

//        Enum15AfterDefault.withParam("现在佛","释迦摩尼");
        Enum15AfterDefault withParam = Enum15AfterDefault.withParam;
        System.out.println(withParam.name());
        System.out.println(withParam.getName());
        System.out.println(withParam.getValue());
    }
}
